package com.frank.circle.controller;

import com.frank.circle.req.SaveMomentReq;
import com.frank.circle.service.MomentService;
import com.frank.common.entity.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Frank Zou
 * @version v0.0.1
 * @date 2025/10/16
 * @description
 */
@RestController
@RequestMapping("/moment")
public class MomentController {

    private final MomentService momentService;


    public MomentController(MomentService momentService) {
        this.momentService = momentService;
    }

    /**
     * save a new moment
     * @param req new moment request
     * @return result
     */
    @PostMapping("/save")
    public Result<Boolean> saveMoment(@RequestBody SaveMomentReq req){
        return Result.ok(momentService.saveMoment(req));

    }

}
